package 每日一题OJ;

import java.util.Scanner;

/**
 * @author shy_black
 * @date 2019/3/21 20:34
 * @Description: /**
 * * 连续奇数和：n^3 等于 连续奇数之和
 *  方法：先用end将num加到刚比sum大一点
 *  在用start缓慢减少num的值，一点一点逼近sum
 */
public class 连续奇数之和等于n的三次方 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        input.close();
        int begin = 1;
        int end = -1;
        int num = 0;
        int sum = n * n * n;
        while (num != sum) {
            if (num < sum) {
                end += 2;
                num += end;
            } else {
                num -= begin;
                begin += 2;

            }
        }

        System.out.println(begin + " " + end);
    }

}
